package com.tdk.bts.util;

import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;

public class ExcelUtil {
	
	
	/**
	 * ����Excel
	 * @param path�ļ�·��
	 * @return
	 */
	public static Map<String,List<String>> importExcel(String path) throws Exception{
		
		Map<String,List<String>> objMap = new HashMap<String,List<String>>();
		try {
				 File file= new File(path);
				 FileInputStream fis = new FileInputStream(file);
				 Workbook rwb = Workbook.getWorkbook(fis);
				 Sheet rs = rwb.getSheet(0); //������ 
				 for(int j = 1; j < rs.getRows(); j++){//�����
					 Cell[] cells = rs.getRow(j);
					 List<String> list = new ArrayList<String>();
					 for(int k=0;k<cells.length;k++){//��Ԫ�����
						 list.add(cells[k].getContents());
					 }
					 objMap.put(j+"", list);
				 }
			
			
			
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return objMap;
	} 

}
